<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.bootcss.com/jquery/3.3.1/jquery.min.js"></script>
</head>

<body>
    <form action="{:url('mobileRegister')}" method="post">
        <div class="form-group">
            <label for="mobile" class="col-sm-2 control-label">手机号:</label>
            <div class="col-sm-4">
                <input type="text" name="mobile" id="mobile" class="form-control" placeholder="手机号">
            </div>
            <label for="mobile_code" class="col-sm-2 control-label">短信验证码:</label>
            <div class="col-sm-2">
                <input type="text" name="mobile_code" id="mobile_code" class="form-control" placeholder="短信验证码">
            </div>
            <div class="col-sm-2">
                <button type="button" onclick="getVerificationCode()">获取验证码</button>
            </div>
        </div>
        <div class="form-group">
            <label for="password" class="col-sm-2 control-label">密码:</label>
            <div class="col-sm-4">
                <input type="text" name="password" id="password" class="form-control" placeholder="密码">
            </div>
            <label for="password_rep" class="col-sm-2 control-label">重复密码:</label>
            <div class="col-sm-4">
                <input type="text" name="password_rep" id="password_rep" class="form-control" placeholder="重复密码">
            </div>
        </div>
        <button type="submit">提交</button>
    </form>
    <a href="{$bind_account_url}">关联已有账号</a>
    <script>
        // $("#mobile").change(function(event){
        //     var mobile=$(event.target).val();
        //     $.post("{:url('checkMobileNumberAvailable')}",{
        //         "mobile":mobile
        //     },function(data){
        //         console.log(data);
        //     })
        // });
        function getVerificationCode(){
            var mobile=$("#mobile").val();
            var security_code="{$  security_code}";
            $.post("{:config('custom.relevance_url')}/sms/sms.php?act=send&flag=register&source=temp",{
                "mobile":mobile,
                "seccode":security_code
            },function(data){
                console.log(data);
            })
        }
    </script>
</body>

</html>
